package com.hht.toolanduilibs.wb

import android.content.ComponentName
import android.content.Context
import android.net.Uri
import com.hht.toolanduilibs.ConfigurationBean
import com.hht.toolanduilibs.startActivityExt
import com.hht.toolanduilibs.startServiceExt
import java.io.File


/**
 * Author:chen'hu
 * Time:2024/9/10 15:23
 * Description:This is OptomaWhiteBoard
 */
class OptomaWhiteBoard(
    configurationBean: ConfigurationBean,
    private val mContext: Context,
) : WhiteBoardImp(configurationBean) {

    override fun sendPicturesToWhiteBoard(file: File?): Boolean {
        return mContext.startActivityExt {
            component = ComponentName(whiteBoardBean.pkgName, whiteBoardBean.className)
            val pathUri = Uri.parse(file?.path)
            setDataAndType(pathUri, "image/*")
        }
    }

    override fun openWhiteBoard(): Boolean {
        return mContext.startActivityExt {
            component = ComponentName(whiteBoardBean.pkgName, whiteBoardBean.className)
        }
    }

    override fun openAnnotation(): Boolean {
        return mContext.startServiceExt {
            component = ComponentName(annotationBean.pkgName, annotationBean.className)
        }
    }
}